package org.zs.miracle.common.validate;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.zs.miracle.common.validate.impl.WordValidatorImpl;

/**
 * 验证字母只允许为大小写字母,可以出现空格
 */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(
    validatedBy = {WordValidatorImpl.class}
)
public @interface ValidateWord {
  String message() default "只允许为大小写字母";
  
  /**
   * 验证参数是否为必须的
   */
  boolean required() default true;
  
  Class<?>[] groups() default {};
  
  Class<? extends Payload>[] payload() default {};
}